Support key-chord
authorjustbur <justin@burkett.cc>
Thu, 31 Mar 2016 14:51:32 +0000 (10:51 -0400)
committerjustbur <justin@burkett.cc>
Thu, 31 Mar 2016 14:55:15 +0000 (10:55 -0400)
Fixes #108

which-key.el

index a0f226bb393a82d78e100b22275038f5ba361155..2706a99062b97e8be706a56b0196205843b823c5 100644 (file)
@@ -2021,6 +2021,18 @@ Finally, show the buffer."
     ;;  (message "key: %s" (key-description prefix-keys)))
     ;; (when (> (length prefix-keys) 0)
     ;;  (message "key binding: %s" (key-binding prefix-keys)))
+    ;; Taken from guide-key
+    (when (and (equal prefix-keys [key-chord])
+               (bound-and-true-p key-chord-mode))
+      (setq prefix-keys
+            (condition-case nil
+                (let ((rkeys (recent-keys)))
+                  (vector 'key-chord
+                          (aref rkeys (- (length rkeys) 2))
+                          (aref rkeys (- (length rkeys) 1))))
+              (error (progn
+                       (message "which-key error in key-chord handling")
+                       [key-chord])))))
     (cond ((and (> (length prefix-keys) 0)
                 (or (keymapp (key-binding prefix-keys))
                     ;; Some keymaps are stored here like iso-transl-ctl-x-8-map